def check(s:str):
    flag = True
    l=len(s)
    i=1
    while i <= l:
        if i % 2 == 1:
            if int(s[l-i]) % 2 == 0:
                flag = False
                break
        else:
            if int(s[l-i]) % 2 == 1:
                flag = False
                break
        i+=1
    return flag

n = int(input())
count = 0
for i in range(1,n+1):
    if i % 2 == 1:
        if check(str(i)):
            count += 1
print(count)